//
//  PPMineMoneyCell.m
//  PPDL
//
//  Created by 王洋 on 2019/7/30.
//  Copyright © 2019 王洋. All rights reserved.
//

#import "PPMineMoneyCell.h"

@interface PPMineMoneyCell ()

@property (weak, nonatomic) IBOutlet UILabel *leijishouyi;
@property (weak, nonatomic) IBOutlet UILabel *wodezichan;
@property (weak, nonatomic) IBOutlet UIView *leijishouyiView;
@property (weak, nonatomic) IBOutlet UIView *wodezichanView;

@end

@implementation PPMineMoneyCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.leijishouyiView.userInteractionEnabled = YES;
    self.wodezichanView.userInteractionEnabled = YES;
    
    WEAKSELF
    [self.leijishouyiView addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
        
        if (weakSelf.mineInfocellClickBlock) {
            weakSelf.mineInfocellClickBlock(Mine_Go_TotalIncome);
        }
    }];
    
    [self.wodezichanView addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {

        if (weakSelf.mineInfocellClickBlock) {
            weakSelf.mineInfocellClickBlock(Mine_Go_MyAution);
        }
    }];
}

- (void)fillCellWithModel:(PPMineMoneyInfoModel *)model {
    
    self.leijishouyi.text = [NSString stringWithFormat:@"¥%@",[Utilities changeDoubleToString:model.accumulatedIncome]];

    self.wodezichan.text = [NSString stringWithFormat:@"¥%@",[Utilities changeDoubleToString:model.myAssets]];

}

@end
